home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - Networking - Security Tools for Windows NT Networks.txt < prev    next >
Text File  |  2003-09-27  |  23KB  |  456 lines

  1. Security Tools For Windows NT NetworksSecurity Tools For Windows NT Networks 
  2. Gary C. Kessler
  3. April 1999 
  4.  
  5.  
  6.   An edited version of this paper appeared with the title "Add Fuel to Your 
  7.   Firewall" in the October 1999 issue of Windows NT Magazine. 
  8. It is common practice today that any network connected to the Internet be 
  9. protected with some sort of firewall. While firewalls are a necessary component 
  10. in the arsenal of tools for the network administrator, they are no longer 
  11. sufficient. Firewalls are relatively static devices in that they enforce a 
  12. particular ruleset. But what happens when valid, legal packets, at least 
  13. according to the rules, are being used to formulate an attack on your network or 
  14. execute an attack against one of your servers? Additional tools must be used for 
  15. additional protection, particularly for the Windows NT environment and TCP/IP 
  16. protocols.
  17. This article will discuss several security tools that can be implemented on 
  18. Windows NT systems to spot potential problems before they are exploited by 
  19. attackers from both the inside and outside, namely port scanners, vulnerability 
  20. testers, log analyzers, and intrusion detectors.
  21. Port Scanning 
  22. The Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) 
  23. identify higher layer services by use of a port number. Port scanners are tools 
  24. used to determine what TCP/UDP services are available on a particular server. 
  25. One of the cardinal rules of server security is to disable any service that is 
  26. not being used. A port scanner can be used by a system administrator to ensure 
  27. that only the desired TCP/UDP services are running. Any open TCP/UDP service 
  28. offers an attacker a possible entree into your system. Having any port open that 
  29. is not absolutely necessary, then, should be avoided, particularly because if 
  30. there is a service running that you don't know about, then you won't be 
  31. monitoring it.
  32. The so-called Well Known Ports are of particular interest; these are port 
  33. numbers between 0 and 1023, and are generally implemented so that these services 
  34. can only be used by system processes or by programs executed by privileged 
  35. users. Exploiting a well known port, then, gives an attacker potential control 
  36. of a server. Some of the well known TCP/UDP ports are listed below; a complete 
  37. list of assigned port numbers can be obtained from the Internet Assigned Numbers 
  38. Authority (IANA, http://www.isi.edu/in-notes/iana/assignments/port-numbers):
  39.       Port # Common
  40.       Protocol Service   Port # Common
  41.       Protocol Service 
  42.       7 TCP echo   70 TCP gopher 
  43.       9 TCP discard   79 TCP finger 
  44.       13 TCP daytime   80 TCP http 
  45.       19 TCP chargen   110 TCP pop3 
  46.       20 TCP ftp-control   111 TCP sunrpc 
  47.       21 TCP ftp-data   119 TCP nntp 
  48.       23 TCP telnet   123 UDP ntp 
  49.       25 TCP smtp   137 TCP/UDP netbios-ns 
  50.       37 UDP time   138 UDP netbios-dgm 
  51.       43 TCP whois   139 TCP netbios-ssn 
  52.       53 TCP/UDP dns   143 TCP imap 
  53.       67 UDP bootps   161 UDP snmp 
  54.       68 UDP bootpc   162 UDP snmptrap 
  55.       69 UDP tftp   520 UDP rip 
  56.  
  57. There are several generic schemes that can be employed to scan ports, although 
  58. most focus on TCP:
  59.   TCP connect() scanning: The most basic form of TCP scanning, where the 
  60.   attacker's host issues a connect() system call to every interesting port on 
  61.   the target machine. If the port is listening, connect() will succeed; 
  62.   otherwise the port is not reachable and the service is not available. This 
  63.   scheme is fast and requires no special privileges, but can be easily detected 
  64.   and blocked at the target system.
  65.  
  66.  
  67.   TCP SYN scanning: Establishing a TCP virtual connection requires what is 
  68.   called a three-way handshake: one host sends a TCP segment with the 
  69.   synchronize (SYN) flag set, the other responds with a segment with both the 
  70.   acknowledge valid (ACK) and SYN flags set, and the first host sends a segment 
  71.   with just the ACK flag set. With SYN scanning, the querying host sends a SYN 
  72.   segment to every port; if the server responds with a SYN-ACK segment, then the 
  73.   service is available; if the server responds with a reset (RST) segment, then 
  74.   this service is not available. These probes can typically be logged by the 
  75.   target site.
  76.  
  77.  
  78.   TCP FIN scanning: With this scheme, the querying host skips the three-way 
  79.   handshake entirely and just sends a finish (FIN) segment to all interesting 
  80.   TCP ports (which, under ordinary circumstances, would close an open TCP 
  81.   connection). If the port is open (i.e., listening or active), the FIN is 
  82.   supposed to be ignored (because there is no existing connection); if the port 
  83.   is closed (i.e., not listening or inactive), a RST segment is generated. Thus, 
  84.   lack of a response indicates an active port. This is a clever way around the 
  85.   problems of SYN scanning and very hard to trace. Ironically, this method 
  86.   doesn't work very well on most Windows systems because Microsoft's TCP 
  87.   implementation always sends a RST in response to a FIN.
  88.  
  89.  
  90.   FTP bounce attack: This type of attack uses the FTP PORT command and the 
  91.   upload capability (if present) at an FTP server behind a firewall to allow a 
  92.   client to connect with other systems that would not be otherwise accessible. 
  93.   Consider this scenario: an attacker creates a text file containing the Simple 
  94.   Mail Transfer Protocol (SMTP) dialog of a spoofed e-mail message and uploads 
  95.   it to an FTP server behind a firewall. The attacker could then issue an FTP 
  96.   PORT command to the server, providing the IP address of the intended target 
  97.   system (say, the mail server) and the SMTP port number. The attacker then 
  98.   sends the file to the victim machine where the e-mail is sent and appears to 
  99.   have come from the FTP server. Obviously, other types of Trojan horse programs 
  100.   or viruses could be inserted behind a firewall in this way, and might also 
  101.   allow a querying client to connect to an FTP server and scan services behind a 
  102.   firewall. Microsoft's FTP server implementation is reportedly immune from this 
  103.   type of attack because it requires that the IP address contained in the PORT 
  104.   command match the original IP address provided on the FTP control channel (TCP 
  105.   port 21). In addition, by default, the PORT command cannot be used to specify 
  106.   any privileged ports (those below 1024) except the FTP data channel (TCP port 
  107.   20).
  108.  
  109.  
  110.   UDP Internet Control Message Protocol (ICMP) port unreachable scanning: 
  111.   Because UDP is a connectionless protocol, it is harder to perform a port scan 
  112.   than in TCP because ports are not required to respond to probes. Most 
  113.   implementations, though, do generate an ICMP port_unreachable error when a 
  114.   packet is sent to a closed UDP port; as in TCP FIN scanning, then, lack of a 
  115.   response indicates an active port. 
  116.  
  117.  
  118.   Screen 1: TCP/UDP vulnerabilities display from WebTrends Security Analyzer. 
  119.  
  120.  
  121.  
  122.  
  123.  
  124. There are several tools that perform port scanning and they may use any 
  125. combination of the methods mentioned above (or other methods); this software can 
  126. be run from either a Unix system (e.g., SATAN, nmap) or a Windows system (see 
  127. Table 1). Screen 1 shows the Web-based display after scanning a group of four 
  128. Windows NT servers for TCP/UDP vulnerabilities using the WebTrends Security 
  129. Analyzer:
  130.   The Most Vulnerable Services graph and table shows that four services are open 
  131.   on these systems, namely the File Transfer Protocol (FTP, on TCP port 21), the 
  132.   Hypertext Transfer Protocol (HTTP, on TCP port 80), the Post Office Protocol 
  133.   version 3 (POP3, on TCP port 110), and SMTP (TCP port 25). The graph shows 
  134.   that FTP is running on two servers, one having a medium risk vulnerability and 
  135.   one a low risk vulnerability. The web (HTTP) is also running on two servers, 
  136.   one a high risk and one a low risk. Finally, POP3 and SMTP are each running on 
  137.   one server, a low risk vulnerability.
  138.  
  139.  
  140.   The Service Vulnerabilities table describes the risks in more detail. The FTP 
  141.   and HTTP services, for example, are low risk vulnerabilities merely because 
  142.   they are running. The medium-risk vulnerability FTP service is one that has 
  143.   enabled anonymous access; the high-risk HTTP service is so noted because the 
  144.   $DATA hole is NT's Internet Information Server (IIS) can be exploited. This 
  145.   latter vulnerability affects many IIS installations, where an attacker can 
  146.   download the active server page (ASP) source by appending the string "::$DATA" 
  147.   to the URL. This can expose usernames and passwords that are hard coded within 
  148.   scripts; SQL and other administrator passwords, for example, are often placed 
  149.   within scripts in this fashion. 
  150. After listing these vulnerabilities, many port scanners will suggest possible 
  151. fixes, such as shutting down the service or installing a hotfix. Of course, 
  152. shutting the service off may not be an option, but we should know that there is 
  153. a possible risk so that we can balance the exposure with the benefit. But this 
  154. type of scan can also remind sysadmins to turn off any service that they are not 
  155. actually using, such as Gopher (which comes standard with IIS, and defaulted to 
  156. enabled in IIS 3).
  157. Vulnerability Testing 
  158. There are many security vulnerabilities that are operating system specific. 
  159. Vulnerability testing is similar to port scanning but whereas port scanning is 
  160. directed at the TCP/IP communications protocols, vulnerability testing is 
  161. directed towards specific operating systems. Although another rule of secure 
  162. management is to avoid advertising the operating system of your servers, 
  163. attackers already have many clues: .asp file extensions, use of .htm rather than 
  164. .html, and home pages named default.htm almost always indicate an IIS server. In 
  165. addition, there are many tools available that allow attackers to determine the 
  166. operating system of another computer and all the attacker needs to use such a 
  167. tool is the server's IP address.
  168.  
  169.  
  170.   Screen 2: Windows NT operating system vulnerabilities display from WebTrends 
  171.   Security Analyzer. 
  172.  
  173.  
  174.  
  175.  
  176. System and network administrators, then, are well-advised to examine their 
  177. systems for operating system vulnerabilities. Screen 2 shows a sample display 
  178. from the WebTrends Security Analyzer directed at four servers. As in the port 
  179. scan report, vulnerabilities are ranked as high, medium, and low risk. This 
  180. report shows that:
  181.   All of the servers were found to have at least one user account with a blank 
  182.   password and at least one user account with a password that is too short (less 
  183.   than 6 characters); in addition, none had the LSA-2 fix installed.
  184.  
  185.  
  186.   Two of the servers were found to have at least one user account locked out and 
  187.   at least one user account with the password the same as the username; in 
  188.   addition, two of the servers use the File Allocation Table (FAT) disk file 
  189.   system instead of the NT File System (NTFS).
  190.  
  191.  
  192.   One of the servers is vulnerable to the $DATA hole exploit. 
  193. This screen also lists about a dozen medium-risk vulnerabilities, followed by 
  194. low-risk vulnerabilities. But knowing about the vulnerabilities is only half the 
  195. battle. Most vulnerability testers will also tell you where you can get more 
  196. information and suggest corrective measures, such as pointers to Microsoft 
  197. knowledge base articles, links to hotfixes and service packs, instructions for 
  198. updating the Registry, or other guidelines. Screen 3, in particular, shows a 
  199. portion of the WebTrends Security Analyzer display listing the suggested fixes 
  200. for the vulnerabilities listed in the previous screen.
  201.  
  202.  
  203.   Screen 3: Suggested fixes to Windows NT operating system vulnerabilities 
  204.   displayed from WebTrends Security Analyzer. 
  205.  
  206.  
  207.  
  208.  
  209. New operating system vulnerabilities, particularly with NT, are appearing all 
  210. the time. Just like antivirus software, then, the database of operating system 
  211. vulnerabilities has to be updated periodically. You can't just run a 
  212. vulnerability test once, fix the problems, and walk away; this is a tool that 
  213. has to be used frequently with the most up-to-date information.
  214. It is important to note that many versions of tools such as port scanners and 
  215. vulnerability testers can be used across a network. Therefore, they can be used 
  216. by network administrators to test their own network as well as by attackers to 
  217. probe someone else's network for weaknesses. Isaac Asimov fans are certainly 
  218. familiar with the adage:
  219.       "It's a poor ... blaster that won't point both ways." 
  220.       Salvor Hardin, mayor of Terminus,
  221.       Foundation (Isaac Asimov, 1951) 
  222.  
  223.  
  224. Log Analyzer 
  225. A third rule of security management is to maintain system logs, particularly for 
  226. your servers and routers. And many sites do diligently maintain logs and turn on 
  227. auditing at the servers. But does anyone read the logs? Log files are typically 
  228. quite large and it is difficult to read a multi-megabyte text file and see any 
  229. serious trends. Log analyzers are programs that read the log files (most audit 
  230. tools, including those with Windows NT, use one of a few standard log formats) 
  231. and prepare a graphical or tabular representation of the data. In the NT 
  232. environment, in particular, some log analyzer products run as stand-alone 
  233. software while others run in conjunction with the operating systems own 
  234. management capabilities.
  235. Different log analyzers report different types of information, of course, but 
  236. the kinds of events to look for include:
  237.   Bandwidth utilization patterns 
  238.   Top users by bandwidth utilization 
  239.   Incoming and outgoing protocol/service usage (e.g., FTP, Web, Telnet) 
  240.   Critical events and host addresses 
  241.   Errors and warnings, and the host addresses 
  242.   VPN usage statistics and external host address 
  243.   Login attempts and failures (and host address is via remote access) 
  244.   Top e-mail senders' and recipients' host addresses (internal and external) 
  245.   Top FTP download (and upload) host address 
  246.   Top Telnet host address 
  247.   Unsuccessful TCP connection setup requests 
  248.   Packets/addresses blocked at firewall/router 
  249.  
  250.  
  251.   Screen 4: Web traffic log display from SessionWall-3. 
  252.  
  253.  
  254.  
  255.  
  256. Screen 4 shows sample output from the SessionWall-3 product, available from 
  257. Platinum Technology (formerly Memco, formerly AbirNet ). This output is a simple 
  258. graphic representation of the outgoing web traffic log, displaying users, type 
  259. of site visited, and number of visits. Screen 5 shows a display from Centrax Log 
  260. Analyst (this product is now available from CyberSafe). This display shows 
  261. information from the error log, indicating failed login and virus/Trojan horse 
  262. events. All of this information, of course, is available in the log files that 
  263. should be enabled anyway. But it may be hard to find a few "bad" events 
  264. interspersed in a large log file and people tend to be able to spot trends 
  265. better in a graphical format than in a list.
  266.  
  267.  
  268.   Screen 5: Error log information display from Centrax Log Analyst. 
  269.  
  270.  
  271.  
  272.  
  273. It is a general truism that you shouldn't log events that you don't care about 
  274. and you shouldn't turn logging on if you're not going to read the logs. These 
  275. aren't merely tongue-in-cheek quips; whether you read the information or not, 
  276. there is data in them there log files and you are, therefore, responsible (and 
  277. possibly legally liable) for the information they contain whether you are 
  278. looking at the data or not. Log analyzers, then, are important tools because 
  279. they allow administrators to quickly make sense of trends and patterns of the 
  280. network traffic, server operations, and internal and external users. They also 
  281. make the logs relevant! Too many sites maintain NT auditing and never look at 
  282. the files.
  283. Intrusion Detection 
  284. Firewalls, proxy servers, port scanners, vulnerability testers, and log 
  285. analyzers are wonderful for blocking unauthorized access, indicating the 
  286. presence of a potential problem, or determining if an attack might have already 
  287. occurred. Only intrusion detectors, however, tell you in real time when unusual 
  288. or suspicious activity is occurring.
  289. There are a number of common threats that can be aimed at your systems and 
  290. detected in real time, as listed below. Additional information on all of the 
  291. "attacks" mentioned below can be found at Microsoft's Security Bulletin page 
  292. (http://www.microsoft.com/security), CERT/CC (http://www.cert.org), or at 
  293. vendors' Web sites of these products):
  294.   Denial of Service (DoS) attacks are intended to block access between a 
  295.   victim's network and the general Internet, generally by overloading critical 
  296.   system resources or usurping all available bandwidth. Examples of DoS attacks 
  297.   include WinNuke (Windows Out of Band), TCP SYN Flooding, Ping Flooding, Ping 
  298.   of Death, ICMP Bombing, Smurf, TearDrop, and Land.
  299.  
  300.  
  301.   Unauthorized access to restricted files and/or commands, as the name implies, 
  302.   are attempts by an attacker to read, write, or modify files and/or execute 
  303.   commands for which he/she does not have permission. These types of attacks may 
  304.   use domain name system (DNS), finger, POP, and sendmail buffer overflow; FTP 
  305.   hijacking; HTTP, IIS, and/or Internet Explorer vulnerabilities; and password 
  306.   attacks on the root (Unix), administrator (Windows NT), or supervisor 
  307.   (NetWare) account.
  308.  
  309.  
  310.   A pre-attack probe is an attempt by an attacker to gain basic information 
  311.   about users, servers, or a network that can be used in subsequent break-in 
  312.   attempts. Examples of pre-attack probes include use of tools such as SATAN or 
  313.   nmap, DNS zone transfers, excessive use of traceroute (Unix) or tracert 
  314.   (Windows), or use of SMTP EXPN (name expansion) and VRFY (verify) commands.
  315.  
  316.  
  317.   Suspicious activity can be any network traffic that is outside of the 
  318.   expected, normal traffic patterns; while often due to error, these aberrant 
  319.   behaviors can also indicate undesired activity on the network. Examples of 
  320.   suspicious activity include use of IP source routing, IP unknown protocol 
  321.   events, excessive FTP uploads, Trivial File Transfer Protocol (TFTP) traffic, 
  322.   Windows NT connections between unrelated systems, access to server Registry 
  323.   files, excessive unsuccessful login attempts to one or more account names, or 
  324.   attempts to delete, modify, deactivate, or flood log/audit files.
  325.  
  326.  
  327.   Hostile code insertion includes the spectrum of programs that can alter the 
  328.   behavior of the system or network, including virus, Trojan horse, and 
  329.   back-door programs, malicious applets, and packet sniffers.
  330.  
  331.  
  332.   Infrastructure attacks are those that target the very systems and facilities 
  333.   that comprise the operational network. Examples of these threats are firewall 
  334.   modifications, router modifications, user account additions/modification, file 
  335.   permission/access control list (ACL) modification, and DNS modification. 
  336.  
  337.  
  338.   Screen 6: ISS RealSecure console screen. 
  339.  
  340.  
  341.  
  342.  
  343. Screen 6 shows the Console screen from ISS's RealSecure. Intrusion detectors 
  344. constantly monitor the activity on the network and protected systems. If a 
  345. particular usage pattern that matches a known attack signature is found, the 
  346. intrusion detector software responds by sending a warning to the system manager, 
  347. either via the software's interface, e-mail, pager, and/or by other means. This 
  348. interface allows a network administrator to view real time events, categorized 
  349. as high, medium, and low priority.
  350. Intrusion detection software is coming into more common usage as security 
  351. incidents themselves become more common and serious. As the attacks become more 
  352. complex and involve multiple sites, it would be advantageous if different 
  353. vendors' intrusion detection software could communicate across sites and share 
  354. data about an ongoing attack. To address this challenge, the Internet 
  355. Engineering Task Force (IETF) created the Intrusion Detection Exchange Format 
  356. Working Group (idwg) to define data formats and protocols for sharing 
  357. information between intrusion detection and response systems, and network 
  358. management systems with which they may interact. Initial specifications are 
  359. expected by the end of 1999. More information about this group can be found at 
  360. http://www.ietf.org/html.charters/idwg-charter.html.
  361. Products for Windows NT
  362. There are several port scanners, vulnerability testers, log analyzers, and 
  363. intrusion detectors that run on Windows NT systems, as listed in Table 1. These 
  364. tools, however, are just a part of the network managers' toolkit and they must 
  365. be employed on a regular basis. Note that although these particular products run 
  366. on NT systems, there is a plethora of software that can detect and probe Windows 
  367. NT systems from non-NT platforms, notably Unix.
  368.  
  369.  
  370. TABLE 1: Some Windows NT security monitoring tools.
  371.       Company/Product Name Port Scanner/
  372.       Vulnerability Tester Log
  373.       Analyzer Intrusion
  374.       Detector 
  375.       Axent (www.axent.com)
  376.            Intruder Alert
  377.            NetProwler
  378.            NetRecon  
  379.        
  380.        
  381.       ╖  
  382.        
  383.       ╖
  384.       ╖
  385.         
  386.       Check Point Software Technologies (www.checkpoint.com)
  387.            RealSecure  
  388.        
  389.        
  390.       ╖ 
  391.       CyberSafe (nΘe Centrax) (www.centraxcorp.com)
  392.            Centrax Log Analyst (CLA)
  393.            eNTrax Security Suite 2.1  
  394.        
  395.       ╖  
  396.       ╖  
  397.        
  398.       ╖ 
  399.       En Garde Systems (www.engarde.com)
  400.            T-sight      
  401.       ╖ 
  402.       Internet Security Systems (ISS) (www.iss.net)
  403.       SAFEsuite Adaptive Network Security Products
  404.            Internet Scanner
  405.            RealSecure
  406.            System Scanner  
  407.        
  408.       ╖
  409.        
  410.       ╖    
  411.        
  412.        
  413.       ╖ 
  414.       Network Associates (www.nai.com)
  415.            CyberCop      
  416.       ╖ 
  417.       Network-1 (www.network-1.com)
  418.            CyberwallPLUS      
  419.       ╖ 
  420.       Platinum Technology (nΘe AbirNet) (www.abirnet.com)
  421.            Session Wall-3    
  422.       ╖  
  423.       ╖ 
  424.       Security Dynamics (www.securitydynamics.com)
  425.            Kane Security Analyst
  426.            Kane Security Monitor  
  427.       ╖    
  428.        
  429.       ╖ 
  430.       Tripwire Security Systems (www.tripwiresecurity.com)
  431.            Tripwire 2.1 for Windows NT      
  432.       ╖ 
  433.       WebTrends (www.webtrends.com)
  434.            WebTrends Security Analyzer
  435.            WebTrends for Firewalls & VPNs  
  436.       ╖  
  437.        
  438.       ╖   
  439.  
  440.  
  441.  
  442. Internet Security With Windows NT by Mark Joseph Edwards (Duke Press) is a good 
  443. place to start to learn about securing your NT boxes. Also check out Maximum 
  444. Security: A Hacker's Guide to Protecting Your Internet Site and Network, 2/e by 
  445. Anonymous (SAMS) and Internet Security, 2/e by Atkins et al. (New Riders), two 
  446. excellent books that offer detailed information about security and tools for 
  447. attacks and defenses. Both books discuss Windows NT within the broad spectrum of 
  448. the general security problem. Don't limit your thinking to just NT; the bad guys 
  449. aren't!!
  450. About the Author: Gary C. Kessler is a senior network security/WAN consultant at 
  451. SymQuest Group (http://www.symquest.com), a network integration consulting 
  452. company in South Burlington, VT. His e-mail address is kumquat@sover.net. 
  453.  
  454.  
  455.  
  456.